import {createStore} from 'redux'
let initState = {
    num:10
}
function reducer(state=initState,action){
    state=JSON.parse(JSON.stringify(state))
   switch(action.type){
       case "DIS":
           state.num = --state.num
           return {...state}
        case "ADD":
            setTimeout(()=>{
                state.num = ++state.num
            },2000)
           return {...state}
    default:
        return state
   }
}
const store = createStore(reducer)
export default store